package day11;

import java.beans.XMLDecoder;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class ProdTest2 {
    public static void main(String[] args) {
        try {
            XMLDecoder xd=new XMLDecoder(new FileInputStream("shangpin.xml"));
            List<Product> list= (List<Product>) xd.readObject();
            xd.close();
            for(Product p:list)
                System.out.println(p);
        } catch ( Exception e) {
            e.printStackTrace();
        }

    }
}
